package com.tek.ding.faceding.network.exception;

import android.content.Context;

import com.tek.ding.faceding.R;


public class ErrorMessageFactory {
    public static String create(Context context, int code) {
        String errorMag = null;
        switch (code) {
            case BaseException.HTTP_ERROR:
                errorMag = context.getResources().getString(R.string.error_http);
                break;
            case BaseException.SOCKET_TIMEOUT_ERROR:
                errorMag = context.getResources().getString(R.string.error_socket_timeout);
                break;
            case BaseException.SOCKET_ERROR:
                errorMag = context.getResources().getString(R.string.error_socket);
                break;
            case BaseException.ERROR_HTTP_400:
                errorMag = context.getResources().getString(R.string.error_http_400);
                break;
            case BaseException.ERROR_HTTP_404:
                errorMag = context.getResources().getString(R.string.error_http_404);
                break;
            case BaseException.ERROR_HTTP_500:
                errorMag = context.getResources().getString(R.string.error_http_500);
                break;
            case BaseException.ERROR_API_SYSTEM:
                errorMag = context.getResources().getString(R.string.error_system);
                break;
            case BaseException.NULL_ERROR:
                errorMag = context.getResources().getString(R.string.error_null);
                break;
            case BaseException.JSON_ERROR:
                errorMag = context.getResources().getString(R.string.error_json);
                break;
            case BaseException.NETWORK_ERROR:
                errorMag = context.getResources().getString(R.string.error_network);
                break;
            default:
                errorMag = context.getResources().getString(R.string.error_unknown);
                break;

        }
        return errorMag;
    }
}
